<?php
	class CFilter
	{
		protected $_charList;
		
		public function __construct($charList = null)
		{
			$this->_charList = $charList;			
		}
		
		public function getCharList()
		{
			return $this->_charList;
		}
	
		public function setCharList($charList)
		{
			$this->_charList = $charList;
			return $this;
		}
	
		public function filter($value)
		{
			if (null === $this->_charList) {
				return $this->_unicodeTrim((string) $value);
			} else {
				return $this->_unicodeTrim((string) $value, $this->_charList);
			}
    	}
		public function trimLeftRight($value){
		}
		
	
		protected function _unicodeTrim($value, $charlist = '\\\\s')
		{
			$this->_charList  = '/!|@|%|\^|\*|\(|\)|\+|\=|\-|\<|\>|\?|\/|,|\:|\;|\'|\"|\&|\#|\[|\]|~|$/i';			
			return preg_replace($this->_charList, '', $value);
		}
	}



?>